import router from './index'
import { routes } from './routes'

router.beforeEach((to, from, next) => {
    if (to.matched.length > 0) {
          console.log(to.name)
           // 路由匹配成功
        // 检查是否有匹配的路由记录
          document.title = to.name as string || '^_^' // 设置页面标题
        next()
      } else {
        next('/') // 或跳转到404页面
      }
})
